<template>
  <div>
    <h2>国外体育新闻</h2>
    <button @click="btnFn">随机</button>
    <div class="bbobx">
      <router-link to="/category/abroadIndex/da">num1</router-link><br />
      <router-link to="/category/abroadIndex/db">num2</router-link><br />
      <router-link to="/category/abroadIndex/dc">num3</router-link>
    </div>
    <div>
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      uname: [
        "/category/abroadIndex/da",
        "/category/abroadIndex/db",
        "/category/abroadIndex/dc",
      ],
    };
  },
  methods: {
    btnFn() {
      let num = Math.floor(Math.random() * 3);
      this.$router.push({
        path: this.uname[num],
      });
    },
  },
};
</script>

<style>
.bbobx {
  margin-top: 20px;
}
.bbobx a {
  margin: 10px;
}
</style>